package cate.common.table.position;

import cate.common.table.ESheet;
import easy.java.dev.note.NoteClass;

import java.util.HashSet;
import java.util.Set;

@NoteClass("布阵")
public class FuncPositionSheet extends ESheet<FuncPositionRow> {

    @Override
    public String getSheetName() {
        return "布阵";
    }


    //需要锁定英雄的功能id
    public Set<Integer> lockFuncIds = new HashSet<>();

    @Override
    protected void onLoaded() {
        lockFuncIds.clear();
        for (FuncPositionRow row : this.getList()) {
            if (row.preset) {
                lockFuncIds.add(row.funcId);
            }
        }
    }

    public FuncPositionRow findRow(int funcId, int posNum) {
        for (FuncPositionRow row : this.getList()) {
            if (row.funcId == funcId && row.posNum == posNum) {
                return row;
            }
        }
        return null;
    }
}